home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5864 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: god.bel.alcatel.be!btmpj7!ian
  2. From: ian@rsd.bel.alcatel.be (Ian Ward)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Tough FACTORIAL math problem...
  5. Date: 21 Feb 1996 08:00:45 GMT
  6. Organization: Alcatel Bell Telephone
  7. Distribution: world
  8. Message-ID: <4gejfd$olp@btmpjg.god.bel.alcatel.be>
  9. References: <312A49F0.167E@silk.gsfc.nasa.gov>
  10. Reply-To: ian@rsd.bel.alcatel.be
  11. NNTP-Posting-Host: btmpj7.rsd.bel.alcatel.be
  12.  
  13. Thomas A. McGlynn said:
  14.  
  15. > If you think about this long enough, it becomes clear that the last digit
  16. > then must be cyclic with a period of no longer than 40.  Consider pairs of
  17. > last digits of numbers and their factorials.  The last digit of the factorial
  18. > must be one of 2,4,6,8 (for n>1) so the combination of the last digit of
  19. > n and the last digit of n! must repeat within a cycle of 40 iterations.
  20. > But since the sequence of last digits of n is fixed (ie., 1234567890), and
  21. > we're starting with the same last digit of n!, the last digits of n! must
  22. > repeat.  Thus the function should be writeable in terms of a lookup table
  23.  
  24. I agree, it should, and I posted progressively more and more solutions to 
  25. this theorised solution, last week, but it doesn't work. 
  26.  
  27.  
  28. ---
  29. Ian Ward's opinions only : ian@rsd.bel.alcatel.be
  30.  
  31. Fetch me the aspirin, learning this c++ is giving me a headache.
  32. - What Bruce Lee might have said, were he alive today.
  33.  
  34.